﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._02_FactoryMethod
{

    /// <summary>
    /// 支付接口
    /// </summary>
    public interface IPayment
    {
        void Pay(decimal amount);
    }

    /// <summary>
    /// 支付宝
    /// </summary>
    public class Alipay : IPayment
    {
        public void Pay(decimal amount) => Console.WriteLine($"支付宝支付: {amount}元");
    }
    /// <summary>
    /// 微信支付
    /// </summary>
    public class WechatPay : IPayment
    {
        public void Pay(decimal amount) => Console.WriteLine($"微信支付: {amount}元");
    }
    /// <summary>
    /// 银联支付
    /// </summary>
    public class UnionPay : IPayment
    {
        public void Pay(decimal amount) => Console.WriteLine($"银联支付: {amount}元");
    }
}
